﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BT_Mang_Nhom13.Library;
using BT_Mang_Nhom13.Checker;
using BT_Mang_Nhom13.Sorter;
namespace BT_Mang_Nhom13
{
    class Program
    {
        static void Main(string[] args)
        {

            Student[] Students = new Student[] { new Student("A",3),
                                                 new Student("B",5),
                                                 new Student("C",2),
                                                 new Student("D",1),};
            MyArray<Student> ArrayStudent = new MyArray<Student>(Students);

            //Sort theo diem Tang dan
            ArrayStudent.Sort(new InterchangeSorter<Student>(), 
                              (Student student1, Student student2) => 
                              { 
                                  return student1.StudentScore.CompareTo(student2.StudentScore); 
                              });

            Console.WriteLine("Diem tang dan");
            ArrayStudent.Print();

            ArrayStudent.Sort(new InterchangeSorter<Student>(),new StudentScoreDescending());
            Console.WriteLine("Diem giam dan");
            ArrayStudent.Print();

            MyArray<int> data = new MyArray<int>(new int[] {5,4,3,2,1});
            data.Sort(new SelectionSorter<int>(), new Ascending<int>());
            data.Print();

            MyArray<Student> data2 = new MyArray<Student>(new Student[]{new Student("Hoang",5.0f),
                                                                        new Student("Minh",3.6f),
                                                                        new Student("Nguyen",7.0f)});
            data2.Sort(new SelectionSorter<Student>(), new Descending<Student>());
            data2.Print();

        }
    }
}
